package com.bwie.pojo;

import java.io.Serializable;
import java.util.List;

public class Result implements Serializable {

    //状态码
    private int code; //需要和前端程序员约定好的
    //提示信息
    private String message;
    //是否成功
    private boolean flag;
    //返回数据
    private Object data;

    /**
     * 增删改使用
     */
    public Result(int code, String message, boolean flag) {
        this.code = code;
        this.message = message;
        this.flag = flag;
    }

    public Result() {
    }

    /**
     * 待返回列表的使用
     * @param code
     * @param message
     * @param flag
     * @param data
     */
    public Result(int code, String message, boolean flag, Object data) {
        this.code = code;
        this.message = message;
        this.flag = flag;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public Result setCode(int code) {
        this.code = code;
        return this;
    }

    public String getMessage() {
        return message;
    }

    public Result setMessage(String message) {
        this.message = message;
        return this;
    }

    public boolean isFlag() {
        return flag;
    }

    public Result setFlag(boolean flag) {
        this.flag = flag;
        return this;
    }

    public Object getData() {
        return data;
    }

    public Result setData(Object data) {
        this.data = data;
        return this;
    }
}
